<?php
namespace app\admin\model;

use think\Model;

class Gcategory extends Model{
    public static function getCateList()
    {
        $model = self::field(true);
        return $model->select();
    }

    public static function Jie($data=[]){
        if (!$data['id']){
            $list=self::where('parent_id',0)
                ->order('sort_order desc');
            return $list->select();
        }else{
            $list=self::where('parent_id',$data['id'])
                ->order('sort_order desc');
            return $list->select();
        }
    }
}